package com.app.mapper;


import com.app.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from `User` where username = #{username}")
    User login(User user);
    @Insert("insert into `User` (username,password,code) values (#{username},#{password},#{code})")
    void add(User user);
    @Delete("delete from `User` where user_id = #{user_id}")
    void delete(int user_id);
    @Update("update `User` set username = #{username},password = #{password},code = #{code} where user_id = #{user_id}")
    void update(User user);
    @Select("select * from `User` where user_id = #{user_id}")
    List<User> list(int user_id);
}
